package com.kzj.controller;

import com.kzj.common.constant.GlobalConstant;
import com.kzj.common.enumerate.RoleEnum;
import com.kzj.common.result.Result;
import com.kzj.common.util.InheritableThreadLocalUtil;
import com.kzj.common.util.ValidateCodeUtil;

import com.kzj.pojo.dto.LoginDto;
import com.kzj.service.CommonService;
import com.kzj.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@RestController
@RequestMapping("/common")
public class CommonController {
    @Autowired
    CommonService commonService;
    @PostMapping("/login")
    public Result login(@RequestBody LoginDto dto, HttpSession session)
    {
      return commonService.login(dto,session);
    }
    @GetMapping("/authCode")
    public Result authCode(HttpSession session, HttpServletResponse response)
    {
        return commonService.authCode(session,response);
    }

}
